<!DOCTYPE html>
<html>
<head>
    <title>Prototype Chaining Example 4</title>
    <script type="text/javascript">
                    
        function SuperType(){
            this.colors = ["red", "blue", "green"];
        }

        function SubType(){            
        }
        
        //inherit from SuperType
        SubType.prototype = new SuperType();

        var instance1 = new SubType();
        instance1.colors.push("black");
        alert(instance1.colors);    //"red,blue,green,black"
        
        var instance2 = new SubType();
        alert(instance2.colors);    //"red,blue,green,black"
        
        
    </script>
</head>
<body>

</body>
</html>